<template>
  <h3>我是axiosTest,测试axios</h3>
  <span>我是返回的内容resData1:{{ resData1 }}</span>
  <span>我是返回的内容resData2:{{ resData2 }}</span>
</template>
<script setup lang="ts">
import request from '@/utils/request'
import { reqLogin } from '@/api/user/index'
let resData1: any = ref(null)
let resData2: any = ref(null)
onMounted(() => {
  request({
    url: 'user/login',
    method: 'post',
    data: {
      username: 'admin',
      password: '123456',
    },
  })
    .then((res) => {
      resData1.value = res.data
    })
    .catch(() => {})
  reqLogin({
    username: 'admin',
    password: '123456',
  })
    .then((res) => {
      resData2.value = res.data
    })
    .catch(() => {})
})
</script>
<style scoped lang="scss"></style>
